package com.boyunv.facade.example02;
/*
 *@description
 * z智能音箱外观类
 *@author boyunv
 *@create 2023/7/23 15:18
 *@version 1.0
 */

public class SmartAppliancesFacade {
     private Light light;
     private TV tv;
     private AtrCondition atrCondition;

     public  SmartAppliancesFacade(){
        this.atrCondition=new AtrCondition();
        this.tv=new TV();
        this.light=new Light();
     }

     public  void  say(String message){
        if(message.contains("打开")){
            on();
        }else if(message.contains("关闭")){
           off();
        }else{
         System.out.println("对不起,没有没请重心");
        }
     }

 private void off() {
  System.out.println("sleep=============");
  light.off();
  tv.off();
  atrCondition.off();
 }

 //起床,语音开启点灯,电视,空调
 private void on() {
  System.out.println("起床后");
      light.on();
      tv.on();
      atrCondition.on();
  
 }

}
